<template>
  <div class="subject">
    <span>{{ item[0] }}</span>
    <span>+</span>
    <span>{{ item[1] }}</span>
    <span>=</span>
    <input type="number" v-model.trim.number="sum" />
    <button @click="$emit('submit', sum)">提交</button>
  </div>
</template>

<script>
export default {
  props: {
    item: {
      type: Array,
      required: true,
    },
  },
  data() {
    return {
      sum: "",
    };
  },
};
</script>

<style scoped>
.subject {
  margin: 5px;
  padding: 5px;
  font-size: 20px;
}
.subject span {
  display: inline-block;
  text-align: center;
  width: 20px;
}
.subject input {
  width: 50px;
  height: 20px;
}
</style>